class User {
  int? id;
  String? username;
  String? password;
  String? email;
  DateTime? createdAt;

  User({
    this.id,
    this.username,
    this.password,
    this.email,
    this.createdAt,
  });

  factory User.fromJson(Map<String, dynamic> json) => User(
    id: json['id'],
    username: json['username'],
    password: json['password'],
    email: json['email'],
    createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt']) : null,
  );

  Map<String, dynamic> toJson() => {
    'id': id,
    'username': username,
    'password': password,
    'email': email,
    'createdAt': createdAt?.toIso8601String(),
  };

  @override
  String toString() {
    return 'User{id: $id, username: $username, password: $password, email: $email, createdAt: $createdAt}';
  }


}
